greater-than
Type
operator
Summary
Compares two values and returns true if the first value is greater than the second value, false otherwise.
Syntax
<value1> > value2
Description
Use the > (greater than) operator to compare two numbers or to compare the alphabetical order of two strings.
When comparing strings, the operator compares the two values character by character, using the ASCII value of each character. For example, "a" comes before "z" in the ASCII character set, so "z" > "a" and "az" > "ab".
If the strings are of different lengths, so that the trailing characters in one string are compared to missing characters in the other, the missing characters are considered to have lower value than any character. For example, "DEF" > "DE". If the two values are equal, value1 > value2 evaluates to false.
If the caseSensitive property is true, the comparison between two strings treats uppercase letters as coming before lowercase letters, so "a" > "A". If the caseSensitive property is false, the comparison is not case-sensitive, so "a" is considered equivalent to "A".
Parameters
Name | Type | Description |
---|---|---|
value1 | The operands value1 and value2 can be numbers, literal strings of characters (delimited with double quotes), or any sources of value. |
Examples
1 > 0 -- evaluates to true
2 > -15 -- evaluates to true
repeat while counter > 0
Related
property: caseSensitive
glossary: property, ASCII, value, return, operator, string, character set, case-sensitive
keyword: string, character, characters
operator: greater-than-or-equals, less-than-or-greater-than, less than
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile